﻿<MudCard Style="height:300px">
</MudCard>

<MudDataGrid Items="@_persons" T="Person" Loading="true"
             Filterable Dense="@_dense" FixedHeader ShowMenuIcon Height="350px">
    <Columns>
        <PropertyColumn Property="x => x.Id" Title="Id" />
        <PropertyColumn Property="x => x.Name" Title="Name" />
    </Columns>
    <PagerContent>
        <MudDataGridPager T="Person" PageSizeOptions="new int[] {10, 1000}" />
    </PagerContent>
</MudDataGrid>

<MudSwitch @bind-Value="@_dense" Label="Dense" />

@code {
    public static string __description__ = "Filter popover positioning when DataGrid FixedHeader is true as well as loading indicator";
    
    private bool _dense;
    private readonly List<Person> _persons = Enumerable.Repeat(0, 100)
        .Select((_, i) => new Person { Id = i, Name = $"Name{i}" })
        .ToList();

    public class Person
    {
        public required int Id { get; init; }

        public required string Name { get; init; }
    }
}
